/**
 * Created by Bella on 21/04/2014.
 */
public class OutputHitsData implements Comparable<OutputHitsData> {

    private String id;
    private double rank;

    public OutputHitsData(String id, double rank) {
        this.id = id;
        this.rank = rank;
    }

    @Override
    public String toString() {
        return "OutputHitsData{" +
                "id='" + id + '\'' +
                ", rank=" + rank +
                '}'+ "\n";
    }

    public double getRank() {
        return rank;
    }

    public String getId() {
        return id;
    }

    @Override
    public int compareTo(OutputHitsData hitsData) {
        if(this.getRank() - hitsData.getRank() > Search.threshold)
            return -1;

        if(this.getRank() - hitsData.getRank() < -Search.threshold)
            return 1;

        return 0;
    }

}
